/**
 * 
 */
package com.vivid.dynamics.oknow.dao;

import java.io.Serializable;

import org.springframework.stereotype.Repository;

import com.vivid.dynamics.oknow.model.User;

/**
 *	DAO methods involing the User.
 * @author jason
 * created at:: Jul 29, 2011 10:33:37 AM
 */
/*
 * Repository annotation states that this class will have 
 * the Exception Translation facility 
 */
@Repository
public interface IUserDAO {
	/**
	 * return the User according to the Key pId
	 * @param pId
	 * @return
	 * @author jason
	 * created at:: Jul 29, 2011  10:34:09 AM
	 */
	public User getUserByKey(final int pId);
	
	/**
	 * save the given pUser to the database; returning the "Key" of the
	 * added entity.
	 * @param pUser
	 * @return
	 * @author jason
	 * created at:: Jul 29, 2011  10:34:45 AM
	 */
	public Serializable newUser(final User pUser);
	
	/**
	 * update/save the given pUser to the database; assume everything is ok, 
	 * the updated value will be persisted to the related table.
	 * @param pUser
	 * @author jason
	 * created at:: Jul 29, 2011  10:35:30 AM
	 */
	public void updateUser(final User pUser);
	
	/**
	 * remove the given user from database. Must provide an Entity with KEYS 
	 * populated.
	 * @param pUser
	 * @author jason
	 * created at:: Jul 29, 2011  2:19:38 PM
	 */
	public void deleteUser(final User pUser);
}
